<?php

namespace addons\xpframework\library\xcore\xcore\utils;

class XcPhpUtils
{
    public static function stringToJson($string)
    {
        $val = json_decode($string, true);
        return $val ? $val : [];
    }

    public static function jsonToString($json)
    {
        if($json==null){
            return null;
        }else{
            return json_encode($json);
        }
    }    
}
